package inits

import (
	"api-client/basic/units"
	"github.com/google/uuid"
	"log"
)

//

func InitConsul() {
	consul := units.NewConsul("14.103.168.20", 8500)
	id := uuid.NewString()
	register := units.ConsulRegister{
		Id:      id,
		Name:    "takeout",
		Tags:    []string{"takeout_client"},
		Address: "127.0.0.1",
		Port:    8111,
	}
	err := consul.Register(register)
	if err != nil {
		return
	}
	log.Println("注册服务成功")

}
